
<template>
  <div>
    <el-table :data="tableData"
              border
              :span-method="arraySpanMethod">
      <el-table-column label="尺寸"
                       width="180px"
                       prop="name"></el-table-column>
      <el-table-column label="颜色"
                       prop="color"></el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {

  props: ['tableData', 'name'],
  data () {
    return {

      tab: this.tableData,
      spanAl: []
    }
  },
  computed: {

  },
  watch: {
    tableData () {
      this.spanAll()
    }
  },
  methods: {
    arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
      if (columnIndex === 0) {

        const _row = this.spanAll[rowIndex]
        const _col = _row > 0 ? 1 : 0;
        return {
          rowspan: _row,
          colspan: _col
        }
      }
    },
    spanAll () {
      let tmp = []
      let contactDot = 0;
      let findIndex = 0

      this.tableData.filter((v, i) => {
        if (v.name === this.name) {
          findIndex = i
        }
      })







    }

  }
}
</script>

<style>
</style>

